import typing
from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication,QWidget,QPushButton
import sys
class MyWidget(QWidget):
    def __init__(self,title):
        super().__init__()
        self.setWindowTitle(title)
        self.resize(640,480)
        self.ui_init()
    def on_btn_click(self):
        print("按钮按下")
    def ui_init(self):
        btn=QPushButton("按钮",self)
        btn.clicked.connect(self.on_btn_click)
        btn.setGeometry(QtCore.QRect(180,80,75,23))
        


if __name__=="__main__":
    app= QApplication(sys.argv)
    w=MyWidget("kyy")
    w.show()
    
    
    sys.exit(app.exec_())